Previous Book Contents Book Index Next

Inside Macintosh: QuickDraw GX Objects /
Chapter 4 - Colors and Color-Related Objects / Colors and Color-Related Objects Reference
Color Set Functions / Retrieving and Replacing Colors in a Color Set


GXGetColorSet

You can use the GXGetColorSet function to retrieve the color values from a color set object.

long GXGetColorSet(gxColorSet source, gxColorSpace *space, 
                   gxSetColor colors[]);
source
A reference to the color set object whose color values you want to retrieve.
space
A pointer to a color space value. On return, specifies the color space for the source color set.
colors
An array of gxSetColor color values. On return, contains the set of color values in the source color set.
function result
The number of color values in the source color set.
DESCRIPTION
The GXGetColorSet function retrieves the color values from the source color set and returns them in the colors array. It also returns the color set's color space in the location pointed to by the space parameter. The function result is the number of colors returned in the colors array.

Before calling GXGetColorSet, you must allocate an array of sufficient size to hold
the color-value array of the color set. If instead you pass nil for the colors parameter, the function does not return any color values, but nonetheless returns (as its function result) the number of colors in the color set. Thus you can make an initial call to GXGetColorSet to determine the size of the array to allocate, and then call it once more to get the color values themselves.

ERRORS, WARNINGS, AND NOTICES
Errors 
out_of_memory 
colorSet_is_nil 
SEE ALSO
To replace the entire array of color values in a color set object, use the GXSetColorSet function, described in the next section. To retrieve some of the color values in a color set object, use the GXGetColorSetParts function, described on page 4-75. To replace some of the color values in a color set object, use the GXSetColorSetParts function, described on page 4-76.

The gxSetColor union is described on page 4-56.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996